//
//  TodayCell.swift
//  appstore
//
//  Created by llbt-sk on 2019/11/5.
//  Copyright © 2019 Roy. All rights reserved.
//

import UIKit

class TodayCell: UITableViewCell {
    
    lazy var backImageView = UIImageView()
    
    var model:TodayModel! {
        didSet {
            backImageView.image = UIImage(named: model.iconImage)
        }
    }
    
    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        self.selectionStyle = .none
        self.initView()
    }
    
    func initView() -> Void {
        
        backImageView = UIImageView()
        backImageView.layer.cornerRadius = 15.0
        backImageView.layer.masksToBounds = true
        backgroundView?.contentMode = .scaleAspectFill
        self.contentView.addSubview(backImageView)
        backImageView.snp.makeConstraints { (make) in
            make.left.equalTo(20.0)
            make.top.equalTo(0.0)
            make.bottom.equalTo(-20.0)
            make.right.equalTo(-20.0)
        }
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
